<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>YDLIDAR SDK: /home/yang/tmp/sdk/include/serial.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="app(2).png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">YDLIDAR SDK
   &#160;<span id="projectnumber">V1.3.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">serial.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef SERIAL_H</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define SERIAL_H</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;limits&gt;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &lt;cstring&gt;</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &lt;sstream&gt;</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &quot;v8stdint.h&quot;</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno"><a class="line" href="namespaceserial.html">   11</a></span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceserial.html">serial</a> {</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div><div class="line"><a name="l00016"></a><span class="lineno"><a class="line" href="namespaceserial.html#a00b3281fa11cea770c0b0c8a106080f8">   16</a></span>&#160;    <span class="keyword">typedef</span> <span class="keyword">enum</span> {</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;        fivebits = 5,</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;        sixbits = 6,</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;        sevenbits = 7,</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;        eightbits = 8</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    } <a class="code" href="namespaceserial.html#a00b3281fa11cea770c0b0c8a106080f8">bytesize_t</a>;</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="namespaceserial.html#a8f45d26bf7c9a06659e75b5004a50481">   26</a></span>&#160;    <span class="keyword">typedef</span> <span class="keyword">enum</span> {</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;        parity_none = 0,</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;        parity_odd = 1,</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;        parity_even = 2,</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;        parity_mark = 3,</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;        parity_space = 4</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    } <a class="code" href="namespaceserial.html#a8f45d26bf7c9a06659e75b5004a50481">parity_t</a>;</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="namespaceserial.html#af5b116611d6628a3aa8f788fdc09f469">   37</a></span>&#160;    <span class="keyword">typedef</span> <span class="keyword">enum</span> {</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;        stopbits_one = 1,</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;        stopbits_two = 2,</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;        stopbits_one_point_five</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    } <a class="code" href="namespaceserial.html#af5b116611d6628a3aa8f788fdc09f469">stopbits_t</a>;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="namespaceserial.html#a93ef57a314b4e562f9eded6c15d34351">   46</a></span>&#160;    <span class="keyword">typedef</span> <span class="keyword">enum</span> {</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;        flowcontrol_none = 0,</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;        flowcontrol_software,</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;        flowcontrol_hardware</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    } <a class="code" href="namespaceserial.html#a93ef57a314b4e562f9eded6c15d34351">flowcontrol_t</a>;</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="structserial_1_1_timeout.html">   58</a></span>&#160;    <span class="keyword">struct </span><a class="code" href="structserial_1_1_timeout.html">Timeout</a> {</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="preprocessor">#ifdef max</span></div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="preprocessor"># undef max</span></div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        <span class="keyword">static</span> uint32_t max() {<span class="keywordflow">return</span> std::numeric_limits&lt;uint32_t&gt;::max();}</div><div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="structserial_1_1_timeout.html#aa4fbd72e16f47c9aea9fb3c32ca17828">   72</a></span>&#160;        <span class="keyword">static</span> <a class="code" href="structserial_1_1_timeout.html">Timeout</a> <a class="code" href="structserial_1_1_timeout.html#aa4fbd72e16f47c9aea9fb3c32ca17828">simpleTimeout</a>(uint32_t timeout) {</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;            <span class="keywordflow">return</span> <a class="code" href="structserial_1_1_timeout.html">Timeout</a>(max(), timeout, 0, timeout, 0);</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;        }</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;</div><div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="structserial_1_1_timeout.html#ada15f2a0ae478cbb62ef79d1633b2b81">   77</a></span>&#160;        uint32_t <a class="code" href="structserial_1_1_timeout.html#ada15f2a0ae478cbb62ef79d1633b2b81">inter_byte_timeout</a>;</div><div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="structserial_1_1_timeout.html#a099244649dec66b6e0548480edeb2b9f">   79</a></span>&#160;        uint32_t <a class="code" href="structserial_1_1_timeout.html#a099244649dec66b6e0548480edeb2b9f">read_timeout_constant</a>;</div><div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="structserial_1_1_timeout.html#a64412753eb2edf1621716dd9f1a4e71e">   83</a></span>&#160;        uint32_t <a class="code" href="structserial_1_1_timeout.html#a64412753eb2edf1621716dd9f1a4e71e">read_timeout_multiplier</a>;</div><div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="structserial_1_1_timeout.html#accf01b97f83564f4ce3d6e5f63e21006">   85</a></span>&#160;        uint32_t <a class="code" href="structserial_1_1_timeout.html#accf01b97f83564f4ce3d6e5f63e21006">write_timeout_constant</a>;</div><div class="line"><a name="l00089"></a><span class="lineno"><a class="line" href="structserial_1_1_timeout.html#a31ddae32907cff9c3d27fa763981317d">   89</a></span>&#160;        uint32_t <a class="code" href="structserial_1_1_timeout.html#a31ddae32907cff9c3d27fa763981317d">write_timeout_multiplier</a>;</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        <span class="keyword">explicit</span> <a class="code" href="structserial_1_1_timeout.html">Timeout</a> (uint32_t inter_byte_timeout_=0,</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;            uint32_t read_timeout_constant_=0,</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;            uint32_t read_timeout_multiplier_=0,</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;            uint32_t write_timeout_constant_=0,</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;            uint32_t write_timeout_multiplier_=0)</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;            : inter_byte_timeout(inter_byte_timeout_),</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;            read_timeout_constant(read_timeout_constant_),</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;            read_timeout_multiplier(read_timeout_multiplier_),</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;            write_timeout_constant(write_timeout_constant_),</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;            write_timeout_multiplier(write_timeout_multiplier_)</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;        {}</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    };</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="classserial_1_1_serial.html">  107</a></span>&#160;    <span class="keyword">class </span><a class="code" href="classserial_1_1_serial.html">Serial</a> {</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <span class="keyword">public</span>:</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;        <span class="keyword">explicit</span> <a class="code" href="classserial_1_1_serial.html">Serial</a> (<span class="keyword">const</span> std::string &amp;port = <span class="stringliteral">&quot;&quot;</span>,</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;            uint32_t baudrate = 9600,</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;            <a class="code" href="structserial_1_1_timeout.html">Timeout</a> timeout = <a class="code" href="structserial_1_1_timeout.html">Timeout</a>(),</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;            <a class="code" href="namespaceserial.html#a00b3281fa11cea770c0b0c8a106080f8">bytesize_t</a> bytesize = eightbits,</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;            <a class="code" href="namespaceserial.html#a8f45d26bf7c9a06659e75b5004a50481">parity_t</a> parity = parity_none,</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;            stopbits_t stopbits = stopbits_one,</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;            flowcontrol_t flowcontrol = flowcontrol_none);</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;        <span class="keyword">virtual</span> ~<a class="code" href="classserial_1_1_serial.html">Serial</a> ();</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;        <span class="keywordtype">bool</span> open ();</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;        <span class="keywordtype">bool</span> isOpen () <span class="keyword">const</span>;</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;        <span class="keywordtype">void</span> close ();</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;        <span class="keywordtype">size_t</span> available ();</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;        <span class="keywordtype">bool</span> waitReadable ();</div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;        <span class="keywordtype">void</span> waitByteTimes (<span class="keywordtype">size_t</span> count);</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;        <span class="keywordtype">int</span> waitfordata(<span class="keywordtype">size_t</span> data_count, uint32_t timeout, <span class="keywordtype">size_t</span> * returned_size);</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;</div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;        <span class="keywordtype">size_t</span> read (uint8_t *buffer, <span class="keywordtype">size_t</span> size);</div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;</div><div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;        <span class="keywordtype">size_t</span> read (std::vector&lt;uint8_t&gt; &amp;buffer, <span class="keywordtype">size_t</span> size = 1);</div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;</div><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;        <span class="keywordtype">size_t</span> read (std::string &amp;buffer, <span class="keywordtype">size_t</span> size = 1);</div><div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;</div><div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;        std::string read (<span class="keywordtype">size_t</span> size = 1);</div><div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;</div><div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;        <span class="keywordtype">size_t</span> readline (std::string &amp;buffer, <span class="keywordtype">size_t</span> size = 65536, std::string eol = <span class="stringliteral">&quot;\n&quot;</span>);</div><div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;</div><div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;        std::string readline (<span class="keywordtype">size_t</span> size = 65536, std::string eol = <span class="stringliteral">&quot;\n&quot;</span>);</div><div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;</div><div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;        std::vector&lt;std::string&gt; readlines (<span class="keywordtype">size_t</span> size = 65536, std::string eol = <span class="stringliteral">&quot;\n&quot;</span>);</div><div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;</div><div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;        <span class="keywordtype">size_t</span> write (<span class="keyword">const</span> uint8_t *data, <span class="keywordtype">size_t</span> size);</div><div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;</div><div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;        <span class="keywordtype">size_t</span> write (<span class="keyword">const</span> std::vector&lt;uint8_t&gt; &amp;data);</div><div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;</div><div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;        <span class="keywordtype">size_t</span> write (<span class="keyword">const</span> std::string &amp;data);</div><div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;</div><div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;        <span class="keywordtype">void</span> setPort (<span class="keyword">const</span> std::string &amp;port);</div><div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;</div><div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;        std::string getPort () <span class="keyword">const</span>;</div><div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;</div><div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;        <span class="keywordtype">void</span> setTimeout (<a class="code" href="structserial_1_1_timeout.html">Timeout</a> &amp;timeout);</div><div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;</div><div class="line"><a name="l00385"></a><span class="lineno"><a class="line" href="classserial_1_1_serial.html#a4b4be39af3e1c68bc6ac09cb55788c86">  385</a></span>&#160;        <span class="keywordtype">void</span> <a class="code" href="classserial_1_1_serial.html#a4b4be39af3e1c68bc6ac09cb55788c86">setTimeout</a> (uint32_t <a class="code" href="structserial_1_1_timeout.html#ada15f2a0ae478cbb62ef79d1633b2b81">inter_byte_timeout</a>, uint32_t <a class="code" href="structserial_1_1_timeout.html#a099244649dec66b6e0548480edeb2b9f">read_timeout_constant</a>,</div><div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;            uint32_t <a class="code" href="structserial_1_1_timeout.html#a64412753eb2edf1621716dd9f1a4e71e">read_timeout_multiplier</a>, uint32_t <a class="code" href="structserial_1_1_timeout.html#accf01b97f83564f4ce3d6e5f63e21006">write_timeout_constant</a>,</div><div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;            uint32_t <a class="code" href="structserial_1_1_timeout.html#a31ddae32907cff9c3d27fa763981317d">write_timeout_multiplier</a>)</div><div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;        {</div><div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;            <a class="code" href="structserial_1_1_timeout.html">Timeout</a> timeout(inter_byte_timeout, read_timeout_constant,</div><div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;                read_timeout_multiplier, write_timeout_constant,</div><div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;                write_timeout_multiplier);</div><div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;            <span class="keywordflow">return</span> setTimeout(timeout);</div><div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;        }</div><div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;</div><div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160;        <a class="code" href="structserial_1_1_timeout.html">Timeout</a> getTimeout () <span class="keyword">const</span>;</div><div class="line"><a name="l00403"></a><span class="lineno">  403</span>&#160;</div><div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;        <span class="keywordtype">bool</span> setBaudrate (uint32_t baudrate);</div><div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;</div><div class="line"><a name="l00425"></a><span class="lineno">  425</span>&#160;        uint32_t getBaudrate () <span class="keyword">const</span>;</div><div class="line"><a name="l00426"></a><span class="lineno">  426</span>&#160;</div><div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;        <span class="keywordtype">bool</span> setBytesize (<a class="code" href="namespaceserial.html#a00b3281fa11cea770c0b0c8a106080f8">bytesize_t</a> bytesize);</div><div class="line"><a name="l00436"></a><span class="lineno">  436</span>&#160;</div><div class="line"><a name="l00443"></a><span class="lineno">  443</span>&#160;        <a class="code" href="namespaceserial.html#a00b3281fa11cea770c0b0c8a106080f8">bytesize_t</a> getBytesize () <span class="keyword">const</span>;</div><div class="line"><a name="l00444"></a><span class="lineno">  444</span>&#160;</div><div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160;        <span class="keywordtype">bool</span> setParity (<a class="code" href="namespaceserial.html#a8f45d26bf7c9a06659e75b5004a50481">parity_t</a> parity);</div><div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160;</div><div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160;        <a class="code" href="namespaceserial.html#a8f45d26bf7c9a06659e75b5004a50481">parity_t</a> getParity () <span class="keyword">const</span>;</div><div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160;</div><div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;        <span class="keywordtype">bool</span> setStopbits (stopbits_t stopbits);</div><div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;</div><div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;        stopbits_t getStopbits () <span class="keyword">const</span>;</div><div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;</div><div class="line"><a name="l00487"></a><span class="lineno">  487</span>&#160;        <span class="keywordtype">bool</span> setFlowcontrol (flowcontrol_t flowcontrol);</div><div class="line"><a name="l00488"></a><span class="lineno">  488</span>&#160;</div><div class="line"><a name="l00495"></a><span class="lineno">  495</span>&#160;        flowcontrol_t getFlowcontrol () <span class="keyword">const</span>;</div><div class="line"><a name="l00496"></a><span class="lineno">  496</span>&#160;</div><div class="line"><a name="l00498"></a><span class="lineno">  498</span>&#160;        <span class="keywordtype">void</span> flush ();</div><div class="line"><a name="l00499"></a><span class="lineno">  499</span>&#160;</div><div class="line"><a name="l00501"></a><span class="lineno">  501</span>&#160;        <span class="keywordtype">void</span> flushInput ();</div><div class="line"><a name="l00502"></a><span class="lineno">  502</span>&#160;</div><div class="line"><a name="l00504"></a><span class="lineno">  504</span>&#160;        <span class="keywordtype">void</span> flushOutput ();</div><div class="line"><a name="l00505"></a><span class="lineno">  505</span>&#160;</div><div class="line"><a name="l00507"></a><span class="lineno">  507</span>&#160;        <span class="keywordtype">void</span> sendBreak (<span class="keywordtype">int</span> duration);</div><div class="line"><a name="l00508"></a><span class="lineno">  508</span>&#160;</div><div class="line"><a name="l00510"></a><span class="lineno">  510</span>&#160;        <span class="keywordtype">bool</span> setBreak (<span class="keywordtype">bool</span> level = <span class="keyword">true</span>);</div><div class="line"><a name="l00511"></a><span class="lineno">  511</span>&#160;</div><div class="line"><a name="l00513"></a><span class="lineno">  513</span>&#160;        <span class="keywordtype">bool</span> setRTS (<span class="keywordtype">bool</span> level = <span class="keyword">true</span>);</div><div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160;</div><div class="line"><a name="l00516"></a><span class="lineno">  516</span>&#160;        <span class="keywordtype">bool</span> setDTR (<span class="keywordtype">bool</span> level = <span class="keyword">true</span>);</div><div class="line"><a name="l00517"></a><span class="lineno">  517</span>&#160;</div><div class="line"><a name="l00531"></a><span class="lineno">  531</span>&#160;        <span class="keywordtype">bool</span> waitForChange ();</div><div class="line"><a name="l00532"></a><span class="lineno">  532</span>&#160;</div><div class="line"><a name="l00534"></a><span class="lineno">  534</span>&#160;        <span class="keywordtype">bool</span> getCTS ();</div><div class="line"><a name="l00535"></a><span class="lineno">  535</span>&#160;</div><div class="line"><a name="l00537"></a><span class="lineno">  537</span>&#160;        <span class="keywordtype">bool</span> getDSR ();</div><div class="line"><a name="l00538"></a><span class="lineno">  538</span>&#160;</div><div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160;        <span class="keywordtype">bool</span> getRI ();</div><div class="line"><a name="l00541"></a><span class="lineno">  541</span>&#160;</div><div class="line"><a name="l00543"></a><span class="lineno">  543</span>&#160;        <span class="keywordtype">bool</span> getCD ();</div><div class="line"><a name="l00544"></a><span class="lineno">  544</span>&#160;</div><div class="line"><a name="l00546"></a><span class="lineno">  546</span>&#160;        uint32_t getByteTime();</div><div class="line"><a name="l00547"></a><span class="lineno">  547</span>&#160;</div><div class="line"><a name="l00548"></a><span class="lineno">  548</span>&#160;    <span class="keyword">private</span>:</div><div class="line"><a name="l00549"></a><span class="lineno">  549</span>&#160;        <span class="comment">// Disable copy constructors</span></div><div class="line"><a name="l00550"></a><span class="lineno">  550</span>&#160;        <a class="code" href="classserial_1_1_serial.html">Serial</a>(<span class="keyword">const</span> <a class="code" href="classserial_1_1_serial.html">Serial</a>&amp;);</div><div class="line"><a name="l00551"></a><span class="lineno">  551</span>&#160;        <a class="code" href="classserial_1_1_serial.html">Serial</a>&amp; operator=(<span class="keyword">const</span> <a class="code" href="classserial_1_1_serial.html">Serial</a>&amp;);</div><div class="line"><a name="l00552"></a><span class="lineno">  552</span>&#160;</div><div class="line"><a name="l00553"></a><span class="lineno">  553</span>&#160;        <span class="comment">// Pimpl idiom, d_pointer</span></div><div class="line"><a name="l00554"></a><span class="lineno">  554</span>&#160;        <span class="keyword">class </span><a class="code" href="classserial_1_1serial_1_1_serial_1_1_serial_impl.html">SerialImpl</a>;</div><div class="line"><a name="l00555"></a><span class="lineno">  555</span>&#160;        <a class="code" href="classserial_1_1serial_1_1_serial_1_1_serial_impl.html">SerialImpl</a> *pimpl_;</div><div class="line"><a name="l00556"></a><span class="lineno">  556</span>&#160;</div><div class="line"><a name="l00557"></a><span class="lineno">  557</span>&#160;        <span class="comment">// Scoped Lock Classes</span></div><div class="line"><a name="l00558"></a><span class="lineno">  558</span>&#160;        <span class="keyword">class </span><a class="code" href="classserial_1_1_serial_1_1_scoped_read_lock.html">ScopedReadLock</a>;</div><div class="line"><a name="l00559"></a><span class="lineno">  559</span>&#160;        <span class="keyword">class </span><a class="code" href="classserial_1_1_serial_1_1_scoped_write_lock.html">ScopedWriteLock</a>;</div><div class="line"><a name="l00560"></a><span class="lineno">  560</span>&#160;</div><div class="line"><a name="l00561"></a><span class="lineno">  561</span>&#160;        <span class="comment">// Read common function</span></div><div class="line"><a name="l00562"></a><span class="lineno">  562</span>&#160;        <span class="keywordtype">size_t</span> read_ (uint8_t *buffer, <span class="keywordtype">size_t</span> size);</div><div class="line"><a name="l00563"></a><span class="lineno">  563</span>&#160;        <span class="comment">// Write common function</span></div><div class="line"><a name="l00564"></a><span class="lineno">  564</span>&#160;        <span class="keywordtype">size_t</span> write_ (<span class="keyword">const</span> uint8_t *data, <span class="keywordtype">size_t</span> length);</div><div class="line"><a name="l00565"></a><span class="lineno">  565</span>&#160;    };</div><div class="line"><a name="l00566"></a><span class="lineno">  566</span>&#160;</div><div class="line"><a name="l00567"></a><span class="lineno">  567</span>&#160;</div><div class="line"><a name="l00571"></a><span class="lineno"><a class="line" href="structserial_1_1_port_info.html">  571</a></span>&#160;    <span class="keyword">struct </span><a class="code" href="structserial_1_1_port_info.html">PortInfo</a> {</div><div class="line"><a name="l00572"></a><span class="lineno">  572</span>&#160;</div><div class="line"><a name="l00574"></a><span class="lineno"><a class="line" href="structserial_1_1_port_info.html#a5d4242cdd6c0d01260e24964af4c23d2">  574</a></span>&#160;        std::string <a class="code" href="structserial_1_1_port_info.html#a5d4242cdd6c0d01260e24964af4c23d2">port</a>;</div><div class="line"><a name="l00575"></a><span class="lineno">  575</span>&#160;</div><div class="line"><a name="l00577"></a><span class="lineno"><a class="line" href="structserial_1_1_port_info.html#a2ba37dd33d47b554aef5c15c1fe8b872">  577</a></span>&#160;        std::string <a class="code" href="structserial_1_1_port_info.html#a2ba37dd33d47b554aef5c15c1fe8b872">description</a>;</div><div class="line"><a name="l00578"></a><span class="lineno">  578</span>&#160;</div><div class="line"><a name="l00580"></a><span class="lineno"><a class="line" href="structserial_1_1_port_info.html#a7d55368e1a4e6ccc9da6f4d339524837">  580</a></span>&#160;        std::string <a class="code" href="structserial_1_1_port_info.html#a7d55368e1a4e6ccc9da6f4d339524837">hardware_id</a>;</div><div class="line"><a name="l00581"></a><span class="lineno">  581</span>&#160;</div><div class="line"><a name="l00582"></a><span class="lineno">  582</span>&#160;    };</div><div class="line"><a name="l00583"></a><span class="lineno">  583</span>&#160;</div><div class="line"><a name="l00584"></a><span class="lineno">  584</span>&#160;    <span class="comment">/* Lists the serial ports available on the system</span></div><div class="line"><a name="l00585"></a><span class="lineno">  585</span>&#160;<span class="comment">    *</span></div><div class="line"><a name="l00586"></a><span class="lineno">  586</span>&#160;<span class="comment">    * Returns a vector of available serial ports, each represented</span></div><div class="line"><a name="l00587"></a><span class="lineno">  587</span>&#160;<span class="comment">    * by a serial::PortInfo data structure:</span></div><div class="line"><a name="l00588"></a><span class="lineno">  588</span>&#160;<span class="comment">    *</span></div><div class="line"><a name="l00589"></a><span class="lineno">  589</span>&#160;<span class="comment">    * \return vector of serial::PortInfo.</span></div><div class="line"><a name="l00590"></a><span class="lineno">  590</span>&#160;<span class="comment">    */</span></div><div class="line"><a name="l00591"></a><span class="lineno">  591</span>&#160;    <span class="comment">//std::vector&lt;PortInfo&gt; list_ports();</span></div><div class="line"><a name="l00592"></a><span class="lineno">  592</span>&#160;</div><div class="line"><a name="l00593"></a><span class="lineno">  593</span>&#160;} <span class="comment">// namespace serial</span></div><div class="line"><a name="l00594"></a><span class="lineno">  594</span>&#160;</div><div class="line"><a name="l00595"></a><span class="lineno">  595</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="classserial_1_1_serial_html_a4b4be39af3e1c68bc6ac09cb55788c86"><div class="ttname"><a href="classserial_1_1_serial.html#a4b4be39af3e1c68bc6ac09cb55788c86">serial::Serial::setTimeout</a></div><div class="ttdeci">void setTimeout(uint32_t inter_byte_timeout, uint32_t read_timeout_constant, uint32_t read_timeout_multiplier, uint32_t write_timeout_constant, uint32_t write_timeout_multiplier)</div><div class="ttdef"><b>Definition:</b> serial.h:385</div></div>
<div class="ttc" id="structserial_1_1_port_info_html_a7d55368e1a4e6ccc9da6f4d339524837"><div class="ttname"><a href="structserial_1_1_port_info.html#a7d55368e1a4e6ccc9da6f4d339524837">serial::PortInfo::hardware_id</a></div><div class="ttdeci">std::string hardware_id</div><div class="ttdef"><b>Definition:</b> serial.h:580</div></div>
<div class="ttc" id="classserial_1_1_serial_1_1_scoped_write_lock_html"><div class="ttname"><a href="classserial_1_1_serial_1_1_scoped_write_lock.html">serial::Serial::ScopedWriteLock</a></div><div class="ttdef"><b>Definition:</b> serial.cpp:44</div></div>
<div class="ttc" id="namespaceserial_html_a8f45d26bf7c9a06659e75b5004a50481"><div class="ttname"><a href="namespaceserial.html#a8f45d26bf7c9a06659e75b5004a50481">serial::parity_t</a></div><div class="ttdeci">parity_t</div><div class="ttdef"><b>Definition:</b> serial.h:26</div></div>
<div class="ttc" id="namespaceserial_html_a00b3281fa11cea770c0b0c8a106080f8"><div class="ttname"><a href="namespaceserial.html#a00b3281fa11cea770c0b0c8a106080f8">serial::bytesize_t</a></div><div class="ttdeci">bytesize_t</div><div class="ttdef"><b>Definition:</b> serial.h:16</div></div>
<div class="ttc" id="namespaceserial_html"><div class="ttname"><a href="namespaceserial.html">serial</a></div><div class="ttdef"><b>Definition:</b> serial.h:11</div></div>
<div class="ttc" id="structserial_1_1_timeout_html_a64412753eb2edf1621716dd9f1a4e71e"><div class="ttname"><a href="structserial_1_1_timeout.html#a64412753eb2edf1621716dd9f1a4e71e">serial::Timeout::read_timeout_multiplier</a></div><div class="ttdeci">uint32_t read_timeout_multiplier</div><div class="ttdef"><b>Definition:</b> serial.h:83</div></div>
<div class="ttc" id="structserial_1_1_timeout_html_a31ddae32907cff9c3d27fa763981317d"><div class="ttname"><a href="structserial_1_1_timeout.html#a31ddae32907cff9c3d27fa763981317d">serial::Timeout::write_timeout_multiplier</a></div><div class="ttdeci">uint32_t write_timeout_multiplier</div><div class="ttdef"><b>Definition:</b> serial.h:89</div></div>
<div class="ttc" id="structserial_1_1_timeout_html"><div class="ttname"><a href="structserial_1_1_timeout.html">serial::Timeout</a></div><div class="ttdef"><b>Definition:</b> serial.h:58</div></div>
<div class="ttc" id="structserial_1_1_port_info_html_a2ba37dd33d47b554aef5c15c1fe8b872"><div class="ttname"><a href="structserial_1_1_port_info.html#a2ba37dd33d47b554aef5c15c1fe8b872">serial::PortInfo::description</a></div><div class="ttdeci">std::string description</div><div class="ttdef"><b>Definition:</b> serial.h:577</div></div>
<div class="ttc" id="structserial_1_1_port_info_html"><div class="ttname"><a href="structserial_1_1_port_info.html">serial::PortInfo</a></div><div class="ttdef"><b>Definition:</b> serial.h:571</div></div>
<div class="ttc" id="structserial_1_1_timeout_html_a099244649dec66b6e0548480edeb2b9f"><div class="ttname"><a href="structserial_1_1_timeout.html#a099244649dec66b6e0548480edeb2b9f">serial::Timeout::read_timeout_constant</a></div><div class="ttdeci">uint32_t read_timeout_constant</div><div class="ttdef"><b>Definition:</b> serial.h:79</div></div>
<div class="ttc" id="structserial_1_1_timeout_html_ada15f2a0ae478cbb62ef79d1633b2b81"><div class="ttname"><a href="structserial_1_1_timeout.html#ada15f2a0ae478cbb62ef79d1633b2b81">serial::Timeout::inter_byte_timeout</a></div><div class="ttdeci">uint32_t inter_byte_timeout</div><div class="ttdef"><b>Definition:</b> serial.h:77</div></div>
<div class="ttc" id="structserial_1_1_port_info_html_a5d4242cdd6c0d01260e24964af4c23d2"><div class="ttname"><a href="structserial_1_1_port_info.html#a5d4242cdd6c0d01260e24964af4c23d2">serial::PortInfo::port</a></div><div class="ttdeci">std::string port</div><div class="ttdef"><b>Definition:</b> serial.h:574</div></div>
<div class="ttc" id="namespaceserial_html_af5b116611d6628a3aa8f788fdc09f469"><div class="ttname"><a href="namespaceserial.html#af5b116611d6628a3aa8f788fdc09f469">serial::stopbits_t</a></div><div class="ttdeci">stopbits_t</div><div class="ttdef"><b>Definition:</b> serial.h:37</div></div>
<div class="ttc" id="classserial_1_1_serial_1_1_scoped_read_lock_html"><div class="ttname"><a href="classserial_1_1_serial_1_1_scoped_read_lock.html">serial::Serial::ScopedReadLock</a></div><div class="ttdef"><b>Definition:</b> serial.cpp:28</div></div>
<div class="ttc" id="classserial_1_1serial_1_1_serial_1_1_serial_impl_html"><div class="ttname"><a href="classserial_1_1serial_1_1_serial_1_1_serial_impl.html">serial::Serial::SerialImpl</a></div><div class="ttdef"><b>Definition:</b> unix_serial.h:27</div></div>
<div class="ttc" id="structserial_1_1_timeout_html_accf01b97f83564f4ce3d6e5f63e21006"><div class="ttname"><a href="structserial_1_1_timeout.html#accf01b97f83564f4ce3d6e5f63e21006">serial::Timeout::write_timeout_constant</a></div><div class="ttdeci">uint32_t write_timeout_constant</div><div class="ttdef"><b>Definition:</b> serial.h:85</div></div>
<div class="ttc" id="classserial_1_1_serial_html"><div class="ttname"><a href="classserial_1_1_serial.html">serial::Serial</a></div><div class="ttdef"><b>Definition:</b> serial.h:107</div></div>
<div class="ttc" id="structserial_1_1_timeout_html_aa4fbd72e16f47c9aea9fb3c32ca17828"><div class="ttname"><a href="structserial_1_1_timeout.html#aa4fbd72e16f47c9aea9fb3c32ca17828">serial::Timeout::simpleTimeout</a></div><div class="ttdeci">static Timeout simpleTimeout(uint32_t timeout)</div><div class="ttdef"><b>Definition:</b> serial.h:72</div></div>
<div class="ttc" id="namespaceserial_html_a93ef57a314b4e562f9eded6c15d34351"><div class="ttname"><a href="namespaceserial.html#a93ef57a314b4e562f9eded6c15d34351">serial::flowcontrol_t</a></div><div class="ttdeci">flowcontrol_t</div><div class="ttdef"><b>Definition:</b> serial.h:46</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
